package tp.pr1;

public class Command
{

	private Directions direction;
	private VerbCommands verb;

	public Command()
	{
		this.verb = VerbCommands.UNKNOWN;
		this.direction = Directions.UNKNOWN;
	}

	public Command(VerbCommands verbCommand)
	{
		this.verb = verbCommand;
		this.direction = Directions.UNKNOWN;
	}
	/*public Command(VerbCommands verbCommand, Directions direction)
	{
		this.verb = verbCommand;
		this.direction = direction;
	}*/
	public boolean isValid()
	{	
		boolean valid=true;
		if ((this.verb == VerbCommands.UNKNOWN)||(this.direction==null))
			valid=false;
		else if ((this.verb == VerbCommands.GO) && (this.direction == Directions.UNKNOWN))
			valid=false;
		
		return valid;	
	}

	public Directions getDirection()
	{

		return this.direction;

	}

	public VerbCommands getVerb()
	{
		return this.verb;
	}

	public void setDirection(Directions direction)
	{
		if (direction==null)
			this.direction=Directions.UNKNOWN;
		else
			this.direction=direction;

	}

}
